package by.myteam.gonki.states.mainstate;

import java.awt.event.KeyEvent;

import javax.swing.JPanel;

import by.myteam.gonki.gui.MainFrame;
import by.myteam.gonki.gui.view.MenuView;
import by.myteam.gonki.logic.KeyStates;
import by.myteam.gonki.util.ResetStateGame;


public class MenuState implements IGameState {

	private JPanel state = new MenuView();
	@Override
	public void perform() {
		ResetStateGame.INSTANCE.reset();
		MainFrame.INSTANCE.removeKeyListener(KeyStates.INSTANCE);
		MainFrame.INSTANCE.changeState(EGameStates.MENU.getState());
		MainFrame.INSTANCE.getTravelTime().stop();
	}

	@Override
	public JPanel getView() {
		return state;
	}

	@Override
	public void keyPressed(KeyEvent e) {
	}
}
